/*
 * @Author: 89-83-77
 * @Description: 请填写当前文件简介
 * @Date: 2025-03-28 10:45:47
 * @LastEditTime: 2025-03-29 15:35:40
 * @FilePath: \fz-yzt-webd:\work\client\src\utils\path.js
 */
export const resolvePath = (...paths) => {
  // 过滤无效值并转换为字符串
  const validPaths = paths
    .filter((p) => p != null)
    .map((p) => String(p).replace(/^\/+|\/+$/g, "")); // 移除前后斜杠

  return "/" + validPaths.filter(Boolean).join("/");
};
// 安全版外部链接检测
export const isExternal = (path) => {
  return typeof path === "string" && /^(https?:|mailto:|tel:)/.test(path);
};
